package org.Vancl.Dao.ImpI;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.Vancl.Dao.tuijianDao;
import org.Vancl.entity.tuijian;
import org.Vancl.utils.BaseDao;


public class tuijianDaoImpI extends BaseDao implements tuijianDao {

	
	public List<tuijian> getid(int id){
		String sql="SELECT * FROM tuijian where typeid =?";
		ResultSet rs=super.executeQuery(sql,id);
		List<tuijian> list=new ArrayList();
		try {
			while(rs.next()) {
				tuijian tuijian=new tuijian();
				tuijian.setTid(rs.getInt("tid"));
				tuijian.setTypeid(rs.getInt("typeid"));
				tuijian.setTimages(rs.getString("timages"));
				tuijian.setTname(rs.getString("tname"));
				tuijian.setTprice(rs.getString("tprice"));
				list.add(tuijian);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			try {
				super.CloseAll(rs, rs.getStatement().getConnection(), rs.getStatement());
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return list;
	}
}
